<docs>
  ## 代办个人社保信息变更服务首页
</docs>
<template>
  <div class="fixedBox">
    <mheader class="index" @back_btn="goBack()" title="代办个人社保信息变更服务"></mheader>
    <!-- 申请须知 开始 -->
    <div class="list">
      <div class="title">
        <h3 class="title-h3">当前状态：存档人员</h3>
      </div>
      <div class="content">
        <button class="btn btn-primary maxwid" @click="nextStep(0,'01',1)">参保基本信息变更</button>
        <button class="btn btn-primary maxwid" @click="nextStep(1,'02',2)">缴费银行变更</button>
        <button class="btn btn-primary maxwid" @click="nextStep(2,'03',3)">缴费基数变更</button>
        <button class="btn btn-primary maxwid" v-show="ddyyShow" @click="nextStep(3,'04',4)">定点医院变更</button>
      </div>
    </div>
    <!-- 提示 -->
      <div class="msgTip">温馨提示：只有当前状态为存档人员才可通过验证预留手机号进行信息变更服务，非当前存档人员不能进行信息变更。</div>
  </div>
</template>
<script>
import Mheader from "@/ldry/group/mheader/mheader";
import $ from "@/common/js/axios";

export default {
  components: { Mheader },
  data() {
    return {
      data: {
        code: "",
        cdjg: ""
      },
      ddyyShow: true
    };
  },
  methods: {
    goBack() {
      this.$router.go(-1);
    },
    nextStep(num, xglx, go) {
      // if(num == 2){
      //    this.$alert({
      //       type: 'warning',
      //       message:'由于社保基数调整，该功能正在升级维护中...'
      //     });
      //     return false;
      // }
      $.get("/dafwgl/bxxxxg/sfkxg", {
        params: {
          xglx: xglx
        }
      }).then(res => {
        let _res = res.returnData;
        if (+_res.executeResult == 1) {
          if (go == 1) {
            // 参保基本信息变更
            this.$router.push({
              path: "/bgone",
              query: { num: num, code: this.code }
            });
          } else if (go == 2) {
            // 缴费银行变更
            this.$router.push({
              path: "/bgtwo",
              query: { num: num, code: this.code }
            });
          } else if (go == 3) {
            // 缴费基数变更
            this.$router.push({
              path: "/bgthree",
              query: { num: num, code: this.code }
            });
          } else if (go == 4) {
            // 定点医院变更
            this.$router.push({
              path: "/bgfour",
              query: { num: num, code: this.code }
            });
          }
        } else {
          this.$alert({
            type: "warning",
            message: _res.message
          });
          return false;
        }
      });
    },
  },
  created() {
    this.code = this.$route.query.code;
    this.cdjg = this.$route.query.cdjg;
    if (this.cdjg == "0000000497") {
      this.ddyyShow = false;
    }
  }
};
</script>
<style scoped lang="scss">
@import "~common/scss/variable.scss";

//竖屏  CSS
@media screen and (orientation: portrait) {
  .index {
    position: relative;
    // height: 100vh;
    width: 100vw;
  }
}
@media screen and (orientation: landscape) {
  //横CSS
}
// 申请须知
.list {
  border: $border;
  background-color: #fff;
  .title {
    display: flex;
    padding: 28px 48px;
    border-bottom: $border;
  }
  .title-h3 {
    font-size: $font-size-large;
    color: $color-text-title;
    flex: 1 1 auto;
    line-height: 80px;
  }
  .content {
    padding: 36px 48px;
  }
}
// 消息提示
.msgTip {
  padding: 36px 48px;
  margin-bottom: $margin-base;
  background-color: #fff;
  border: $border;
  margin-top: $margin-base;
  position: relative;
  color: #ffa149;
  line-height: 1.5;
  font-size: 0.44444rem;
}
.maxwid {
  width: 100%;
  margin-top: 30px;
}
</style>
